﻿@model FriendAD.web.Areas.Member.Models.CreateArticleModelView
@{
    ViewBag.Title = "发布文章";
}
<script type="text/javascript">
    $(function () {
        $(".cjclas").click(function () {
            var cjclasid = "id=" + $(this).attr("id");
            $.ajax({
                url: '@Url.Action("articleinfo")',
                data: cjclasid,
                type: "post",
                cache: false,
                beforeSend: function () {
                    $(".cjlist").html("<span class='loading'><img src='/Content/img/loading.gif' width='81' height='78'></span>");
                },
                success: function (data) {
                    $(".cjlist").html(data);
                },
                error: function () {
                    $(".cjlist").html("信息加载失败,请稍后重试!");
                }
            });
        });
        $(".copyurl").click(function () {
            var fburl = $(this).attr("id");
            $("#url").val(fburl);
        });
        $(".sharenow").click(function () {
            if($("#ad").val()==null||$("#ad").val()==undefined||$("#ad").val()=="")
            {
                alert('请选择广告');
                return false;
            }

            var urloption = "@Url.Action("SaveArticle")";
            var adid = $("#ad").val();
            var wechaturl = $(this).attr("data-url");
            var adloca = $('input:radio[name="loca"]:checked').val();
            var wechat = $('input:radio[name="wechatStatus"]:checked').val();

            var urloption =urloption+ "?url=" + wechaturl + "&adloca=" + adloca + "&wechat=" + wechat+"&adid="+adid;
            window.open(urloption);
        });
    });

    function postcheck() {
        if ($("#url").val == "") {
            alert('请填写原文链接！');
            $("#url").focus();
            return false;
        }

        if ($("#ad").val() == null || $("#ad").val() == undefined || $("#ad").val() == "") {
            alert('请选择广告！');
            $("#ad").focus();
            return false;
        }
        document.forms[0].submit();
        return true;
    }
</script>
@using (Html.BeginForm("SaveArticle", "home", FormMethod.Post))
{
    @Html.AntiForgeryToken()
    <input type="hidden" name="artid" value="<?php echo time().rand(10,1000);?>" />
    <input type="hidden" name="type" value="1" />
    <dl class="clearfix">
        <dd class="inptmain">
            <span class="link_inpt">@Html.TextBoxFor(mod => mod.url, new { placeholder = "请输入原文链接" })</span>
            <span class="btnss"><input type="button" name="signup" value="分享" onclick="return postcheck();"></span>
        </dd>
    </dl>
    <dl class="clearfix">
        <dd>
            @Html.DropDownListFor(m => m.ad, ViewBag.list as List<SelectListItem>, "请选择广告", new { @class = "input_txt sel" })
        </dd>
    </dl>

    <dl class="clearfix">

        <dd>
            广告位置：
            <label>
                顶部
                @Html.RadioButtonFor(mod => mod.loca, 1)
            </label>
            <label style="margin-left:10px;">
                底部
                @Html.RadioButtonFor(mod => mod.loca, 0, new { @checked="checked"})
            </label>


        </dd>
        <dd>
            <span style="margin-left:16px;">公众号：</span>
            <label>
                显示
                @Html.RadioButtonFor(mod => mod.wechatStatus, 1, new { @checked = "checked" })
            </label>
            <label style="margin-left:10px;">
                隐藏
                @Html.RadioButtonFor(mod => mod.wechatStatus, 0)
            </label>
        </dd>

        <div class="blank10"></div>

        <div class="btn_box">
            <input type="button" name="signup" class="button" value="直接发布文章" onClick="window.open('add_article.php');" style="width:49%;height:30px;line-height:30px" align="left">
            <input type="button" name="signup" class="button" value="会员购买" onClick="window.open('hygm.php');" style="width:49%;height:30px;line-height:30px" align="right">
        </div>


        <dd style="color:#F1901F; font-size:12px;line-height:30px;  margin-top:6px; height:30px; border-top:#ccc 1px solid;">声明：禁止发布黄赌毒以及违反任何国家相关法律法规的信息</dd>
    </dl>
    <div class="cjfenlei">
        <a id="0" class="cjclas" href="javascript:void(0);">热门</a>
        <a id="1" class="cjclas" href="javascript:void(0);">推荐</a>
        <a id="2" class="cjclas" href="javascript:void(0);">段子</a>
        <a id="3" class="cjclas" href="javascript:void(0);">养生</a>
        <a id="4" class="cjclas" href="javascript:void(0);">私房</a>
        <a id="5" class="cjclas" href="javascript:void(0);">八卦</a>
        <a id="6" class="cjclas" href="javascript:void(0);">生活</a>
        <a id="7" class="cjclas" href="javascript:void(0);">财经</a>
        <a id="8" class="cjclas" href="javascript:void(0);">汽车</a>
        <a id="9" class="cjclas" href="javascript:void(0);">科技</a>
        <a id="10" class="cjclas" href="javascript:void(0);">潮人</a>
        <a id="11" class="cjclas" href="javascript:void(0);">辣妈</a>
        <a id="12" class="cjclas" href="javascript:void(0);">点赞</a>
        <a id="13" class="cjclas" href="javascript:void(0);">旅行</a>
        <a id="14" class="cjclas" href="javascript:void(0);">职场</a>
        <a id="15" class="cjclas" href="javascript:void(0);">美食</a>
        <a id="16" class="cjclas" href="javascript:void(0);">古今</a>
        <a id="17" class="cjclas" href="javascript:void(0);">学霸</a>
        <a id="18" class="cjclas" href="javascript:void(0);">星座</a>
        <a id="19" class="cjclas" href="javascript:void(0);">体育</a>
        <a id="pc_20" class="cjclas" href="http://weixin.sogou.com/?p=73141200&kw=">更多</a>
    </div>
    <div class="cjcontlist">
        <ul class="cjlist">
            @Html.Action("ArticleInfo")
        </ul>
    </div>

    <div class="blank10"></div>
    <script>
    </script>
}
